home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / tjgold.zip / INSTALL.003 / DEMIO12.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-29  |  4KB  |  123 lines

  1. {--------------------------------------------------------------------------}
  2. {                Product: TechnoJock's Turbo Toolkit GOLD                  }
  3. {                                                                          }
  4. {                     TTT GOLD - DEMO PROGRAM                        }
  5. {                                                                          }
  6. {                Copyright 1986-1995  TechnoJock Software, Inc.            }
  7. {                           All Rights Reserved                            }
  8. {                          Restricted by License                           }
  9. {--------------------------------------------------------------------------}
  10.  
  11. {Description: DEMIO12.PAS
  12.               Uses an IO form in a window to create a grid-style pick-list.
  13. }
  14.  
  15. program DEMIO12;
  16.  
  17. {$I GOLDFLAG.INC}
  18.  
  19. uses  DOS, CRT, GoldAttr, GoldHard, GoldFast, GoldWin, GoldIO, GoldIO2,
  20.                 GoldLink, GoldStr, GoldKey, GoldMisc, GoldList, GoldGrid;
  21.  
  22. var
  23.    SourceList: SingleLL;
  24.    ListProperties: ListCfg;
  25.    TabsString,
  26.    GridHeading: string;
  27.    TabStops: array[1..5] of integer;
  28.  
  29. procedure SetScreen;
  30. {Paints the background}
  31. begin
  32.    Clear(WhiteOnLightGray,'░');
  33.    ClearLine(1,YellowOnBlue);
  34.    ClearLine(25,LightgrayOnBlue);
  35.    WriteCenter(25,UseTint,' Copyright (c) 1995 TechnoJock Software Inc. ');
  36.    WriteCenter(1,UseTint,' A Grid Window ');
  37. end; {SetScreen}
  38.  
  39. procedure ShutDown;
  40. {}
  41. begin
  42.    PromptOK(' ERROR! ','Not enough memory to run program!');
  43.    halt;
  44. end; { ShutDown }
  45.  
  46.  
  47. procedure FillTheList;
  48. {}
  49. var I: integer;
  50. begin
  51.    I := 0;
  52.    InitSLLStr(SourceList);
  53.    SLLSetActiveList(SourceList);
  54.    inc(I,SLLAddStr('R D Smith        22202 Chevy Chase    Maryland      WI  23233'));
  55.    inc(I,SLLAddStr('M J Dooley       1123 Queens Blvd     Madison       WI  23278'));
  56.    inc(I,SLLAddStr('E L G Jognson    12623 Ashford Hills  Houston       TX  77079'));
  57.    inc(I,SLLAddStr('P R Group        4585 The Grille #21  Bose          HI  90991'));
  58.    inc(I,SLLAddStr('Mark Norman      34 The Ridgeway      Delaware      OR  33789'));
  59.    inc(I,SLLAddStr('Jennifer Worth   22 The Circle        Illinois      RI  22445'));
  60.    inc(I,SLLAddStr('Susan Jones      52242 #12 South Road Fort Bender   MA  26889'));
  61.    inc(I,SLLAddStr('J T Ainsworth    164 Dunvale Lanee    Texas         TX  77023'));
  62.    inc(I,SLLAddStr('Geoff Range      18 Meadow Wood       Washington    WA  67833'));
  63.    inc(I,SLLAddStr('Joey Doolittle   229 Oak Drive        San Francisco CA  21345'));
  64.    inc(I,SLLAddStr('Sally Weathers   79 Anchors Road      Kennebunport  MA  66720'));
  65.    inc(I,SLLAddStr('G N Greene       816a Hwy 68 South    Portland      OR  23763'));
  66.    if I <> 0 then
  67.       Shutdown;
  68.    Gridheading := 'Name             Street               City          ST  Zip';
  69.    TabStops[1] := 1;
  70.    TabStops[2] := 18;
  71.    TabStops[3] := 39;
  72.    TabStops[4] := 53;
  73.    TabStops[5] := 57;
  74. end; {FillTheList}
  75.  
  76. procedure SetFields;
  77. {}
  78. var I : Integer;
  79. begin
  80.    CreateForms(1);
  81.    ActivateForm(1);
  82.    AllowEsc(true);
  83.    {Add all the fields}
  84.    SetFormWindow(15,6,65,19,1);
  85.    WinSetTitle(FormWinNum,' Tag one or more names ');
  86.    WinSetType(FormWinNum,WMove);
  87.    WinSetShowNum(FormWinNum,false);
  88.    KwikAddField(1, 2,2);
  89.    KwikAddField(2,13,11);
  90.    KwikAddLastField(3, 30,11);
  91.    {The List}
  92.    FillTheList;
  93.    InitListCfg(ListProperties);
  94.    ListSetTagging(ListProperties,true);
  95.    ListAssignSLL(ListProperties,SourceList);
  96.    GridAssignTabs(ListProperties,@TabStops,5);
  97.    GridListField(1,47,8,ListProperties);
  98.    {Buttons}
  99.    ButtonDefaultField(2,'   ~O~K   ',finished);  {OK selected if user presses Enter}
  100.    ButtonField(3,' C~a~ncel ',escaped);
  101.    SetHK(2,280);
  102.    SetHK(3,286);
  103. end; {SetFields}
  104.  
  105. begin
  106. {$IFOPT D+}
  107.    HeapRecord;
  108. {$ENDIF}
  109.    SetScreen;
  110.    SetFields;
  111.    MouseShow(true);
  112.    ProcessInput(1);
  113.    DisposeFields;
  114.    DisposeForms;
  115.    SLLSetActiveList(SourceList);
  116.    SLLDestroy;               {dispose of the list 'cos IO won't do it!}
  117.    MouseShow(false);
  118.    Clear(LightGrayOnBlack,' ');
  119. {$IFOPT D+}
  120.    HeapCheck;
  121. {$ENDIF}
  122. end.
  123.